/* 
 *	Copyright 2014  Yanqing Wu
 *		email: yqwu_yqwu@126.com
 *
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
*/

#pragma once

#include <map>
#include <fstream>
#include "StdCtrlSkin_Enums.h"

//#define __DUMPTEST

class CStdCtrlSkin_BaseElt
{
protected:
	//	Other attributes, for user customize
	std::map<CString, CString> m_custom_attrib;

public:

	CStdCtrlSkin_BaseElt(void)
	{
	}

	virtual ~CStdCtrlSkin_BaseElt(void)
	{
	}

	virtual std::map<CString, CString> GetCustomAttrib(void)
	{
		return m_custom_attrib;
	}

	virtual void SetCustomAttrib(CString name, CString value)
	{
		m_custom_attrib[name] = value;
	}
#ifdef __DUMPTEST
	virtual void Dump(std::ofstream& fio, CStdCtrlSkin_EnumDump type)
	{
		if ( !((int)type & (int)CStdCtrlSkin_EnumDump::OTHER_ATTRIB) )
			return;
		fio << "Other attributes:\n";
		for(auto i : m_custom_attrib)
		{
			CStringA nameA(i.first), valueA(i.second);
			fio << "\t" << nameA.GetString() << "=" << valueA.GetString();
		}
		fio << std::endl;
	}
#endif
};

